package com.redwolfsoft.libshoppingserver.favorite;

import net.sf.json.JSONObject;



public class FavoriteShoppingcenterItemInfo {
	public final static String TAG = "FavoriteShoppingcenterItemInfo";
	
	private String shoppingCenterId;
	private String shoppingCenterName;
	private String shoppingCenterUrl;

	public FavoriteShoppingcenterItemInfo()
	{}
	
	public FavoriteShoppingcenterItemInfo(String shoppingCenterId,
			String shoppingCenterName,String shoppingCenterUrl)
	{
		this.shoppingCenterId=shoppingCenterId;
		this.shoppingCenterName=shoppingCenterName;
		this.shoppingCenterUrl=shoppingCenterUrl;
	}
	
	public FavoriteShoppingcenterItemInfo(JSONObject obj)
	{
		if(obj==null)
		{
			//Log.w(TAG, "JSONObject is null");
			return;
		}
		//try {	
			shoppingCenterId = obj.getString("shoppingCenterId");
			shoppingCenterName = obj.getString("shoppingCenterName");
			shoppingCenterUrl = obj.optString("shoppingCenterUrl");
			
		//} catch (JSONException e) {			
		//	e.printStackTrace();
		//}
	}
	public JSONObject toJsonObject()
	{
		JSONObject obj = new JSONObject();
		//JSONObject obj2 = new JSONObject();
		//try {
			obj.put("shoppingCenterId", shoppingCenterId);
			obj.put("shoppingCenterName", shoppingCenterName);
			obj.put("shoppingCenterUrl", shoppingCenterUrl);
			
			//obj2.put(TAG, obj);
		//} catch (JSONException e) {
			// TODO Auto-generated catch block
		//	e.printStackTrace();
		//	return null;
		//}
		return obj;
		
	}
	
	public String getShoppingCenterId() {
		return shoppingCenterId;
	}

	public void setShoppingCenterId(String shoppingCenterId) {
		this.shoppingCenterId = shoppingCenterId;
	}

	public String getShoppingCenterName() {
		return shoppingCenterName;
	}

	public void setShoppingCenterName(String shoppingCenterName) {
		this.shoppingCenterName = shoppingCenterName;
	}

	public String getShoppingCenterUrl() {
		return shoppingCenterUrl;
	}

	public void setShoppingCenterUrl(String shoppingCenterUrl) {
		this.shoppingCenterUrl = shoppingCenterUrl;
	}

	@Override
	public String toString() {
		return "FavoriteShoppingcenterItemInfo [shoppingCenterId="
				+ shoppingCenterId + ", shoppingCenterName="
				+ shoppingCenterName + ", shoppingCenterUrl="
				+ shoppingCenterUrl + "]";
	}
	
	
	

}
